package ooday03.homework02;

public class RefArrayDemo {
    public static void main(String[] args) {


        Dog[] dogs = new Dog[2];
        dogs[0]=new Dog("小白",9,"黄");
        dogs[1]=new Dog("小灰",8,"白");
        for(int i=0;i< dogs.length;i++) {
            dogs[i].eat();
            dogs[i].swim();
        }
        Chick[] chicks=new Chick[2];
        chicks[0]=new Chick("张三",4,"白");
        chicks[1]=new Chick("李林",5,"灰");
        for (int i=0;i<chicks.length;i++){
            chicks[i].drink();
            chicks[i].layEggs();
        }
        Fish[] fish=new Fish[2];
        fish[0] =new Fish( "周密",4,"白");
        fish[1] =new Fish("老板",5,"灰");
        for (int i=0;i< fish.length;i++){
            fish[i].swim();
        }


        }
    }
